package com.zhkc.wisdom.common.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Description 分页DTO
 * @User zzw
 * @Date 11:04 2023/11/5
 * @company zhkc
 */
@Schema(description = "分页DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PageDTO implements Serializable {
    /**
     * 当前页码
     */
    @Schema(description = "当前页码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "请输入当前页码")
    @Min(value = 0)
    @Max(value = 99999999)
    private Integer page = 1;

    /**
     * 每页记录数
     */
    @Schema(description = "每页记录数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "请输入当前页码")
    @Min(value = 0)
    @Max(value = 99999999)
    private Integer size = 20;
}
